﻿<cfscript>
/** 
* ORM StudentExam
* 
* @hint "Hibernate persistenter t_student_exam. 学生学期考试安排表" 
* 
*/ 

component 
	displayname="public.service.orm.senate.StudentExam" 
	output=false 
	persistent=true 
	selectBeforeUpdate=true dynamicInsert=true dynamicUpdate=true 
	cacheuse="Transactional" 
	entityname="StudentExam" 
	table="t_student_exam"
	{
		
	property type="string" name="ExamerID" column="scex_id" fieldtype="id" generator="assigned" hint="学生考试号";
		
	property type="string" name="SitIndex" column="sitidx" hint="座次号";
	property type="string" name="ChooseID" column="scc_id" hint="学生选课号";
		
	property name="Student" fieldtype="many-to-one" fkcolumn="stu_id" cfc="Student"  hint="学生";
	property name="ExamTask" fieldtype="many-to-one" fkcolumn="task_exid" cfc="ExamTask"  hint="考试任务";
	property name="Classroom" fieldtype="many-to-one" fkcolumn="cr_id" cfc="Classroom"  hint="考场";
		
	/**
	* @hint "自定义主键规则"
	* 
	* @ExamTask "考试任务"
	* @Student "学生"
	*/	
	public string function getID( required ExamTask, required Student ) output=false {
		
		var nextID = arguments.ExamTask.getTaskExamID() & arguments.Student.getStudentID();

		/* 
			主键生成规则 
			
			考试任务号30位 10位考试号 20位学号

			Unique: TASK_EXID, STU_ID
		*/
		return nextID;
	}
		
}
	
</cfscript>

